package com.cxcy.swustlearner.exception;

import common.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
/**
 * 全局异常处理器
 */
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)//捕获全局异常
    public Result exception(Exception e) {
        e.printStackTrace();
        return Result.fail("处理异常，请联系网站管理员");
    }
}
